package com.idanchuang.user.count.service.api.request.command.count;

import com.idanchuang.user.count.service.api.request.command.BaseUpdateCommand;
import com.idanchuang.user.count.service.api.request.command.UserRelated;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 单一用户，多个场景联动增减
 * @author Richard_yyf
 * @version 1.0 2021/5/21
 */
public class UserMultiScenesCountUpdateCommand extends BaseUpdateCommand implements UserRelated {


    /**
     * 用户code
     */
    @NotNull
    private Integer userCode;

    /**
     * 批量更新多个用户场景的计数
     * 会按照顺序，依次执行。如果业务上有相关需求，调用者请借此保证业务语义上的顺序性！
     * 注意：联动更新最多支持3个更新命令！！
     */
    @NotEmpty
    private List<SceneCountIncrement> sceneCountIncrements;

    public UserMultiScenesCountUpdateCommand() {
    }

    public List<SceneCountIncrement> getSceneCountIncrements() {
        return sceneCountIncrements;
    }

    public void setSceneCountIncrements(List<SceneCountIncrement> sceneCountIncrements) {
        this.sceneCountIncrements = sceneCountIncrements;
    }

    @Override
    public Integer getUserCode() {
        return userCode;
    }

    public void setUserCode(Integer userCode) {
        this.userCode = userCode;
    }

    @Override
    public String toString() {
        return "UserMultiScenesCountUpdateCommand{" +
                "userCode=" + userCode +
                ", sceneCountIncrements=" + sceneCountIncrements +
                "} " + super.toString();
    }
}
